<template>
  <div id="app-container">
    <u-page title="美陈需求单">
      <el-descriptions class="frominfo" :model="form">
        <el-descriptions-item label="申请人员">{{ form.applicantnickname }}【{{ form.applicantusername }}】</el-descriptions-item>
        <el-descriptions-item label="表单编号">{{ form.code }}</el-descriptions-item>
        <el-descriptions-item label="申请时间">{{ form.applyTime }}</el-descriptions-item>
        <el-descriptions-item label="填表人员">{{ form.preparernickname }}【{{ form.preparerusername }}】</el-descriptions-item>
        <el-descriptions-item label="表单状态">{{ form.statusstr }}</el-descriptions-item>
        <el-descriptions-item label="结束时间">{{ form.endTime }}</el-descriptions-item>
        <!--        <el-descriptions-item label="当前处理人"></el-descriptions-item>-->
      </el-descriptions>
      <el-form ref="contractform" :model="form" :rules="contractform" label-width="110px" label-position="left" size="mini">
        <div class="contractDetailBox">
          <el-row>
            <el-col :span="6">
              <el-form-item label="扣费部门" prop="deptid" style="padding-top: 10px">
                <el-cascader
                  ref="depts"
                  v-model="form.deptid"
                  :options="deptList"
                  :show-all-levels="false"
                  :disabled="cansave||form.demanddetailsData.length!=0"
                  @change="handledeptChanged"
                />
              </el-form-item>
            </el-col>
          </el-row>
          <el-form-item label="费用承担方" prop="contracttype">
            <el-select v-model="form.contracttype" placeholder="请选择合同类型" :disabled="cansave" @change="handleContracttypeChanged">
              <el-option v-for="item in contractTypes" :key="item.id" :label="item.label" :value="item.value" />
            </el-select>
          </el-form-item>
          <el-form-item label="付款方式" prop="paytype" :hidden="form.contracttype==='公司承担'" :rules="{ required: form.contracttype!=='公司承担', message: '请选择付款类型', trigger: 'change' }">
            <el-radio-group v-model="form.paytype" :disabled="cansave">
              <el-radio label="账扣" />
              <el-radio label="现金缴款" />
            </el-radio-group>
          </el-form-item>
          <el-form-item label="物品类型" prop="itemtype" :rules="{message: '请选择物品类型', trigger: 'change' }">
            <el-radio-group v-model="form.itemtype" :disabled="cansave||form.demanddetailsData.length!=0" @change="itemtypeChange()">
              <el-radio label="POP" value="POP"/>
              <el-radio label="美陈物料" value="美陈物料"/>
            </el-radio-group>
          </el-form-item>
          <el-form-item label="内容说明" prop="remarks">
            <textarea v-model="form.remarks" style="width:80%;height: 150px;" :disabled="cansave" />
          </el-form-item>
          <el-form-item label="需求详情" />
          <div>
            <template>
              <el-table ref="detailfrom" :data="form.demanddetailsData" :border="true">
                <el-table-column key="choose" label="选择合同" prop="choose" width="140">
                  <template slot-scope="scope">
                    <el-button type="text" @click="fetchData(scope.$index)">选择合同</el-button>
                  </template>
                </el-table-column>
                <el-table-column key="firmcode" label="厂商编号" prop="firmcode" width="180">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.firmcode" style="width: 155px" :disabled="true" />
                  </template>
                </el-table-column>
                <el-table-column key="firmname" label="厂商名称" prop="firmname" width="280">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.firmname" style="width: 250px" :disabled="true" />
                  </template>
                </el-table-column>
                <el-table-column key="hth" label="合同号" prop="hth" width="180">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.hth" style="width: 155px" :disabled="true" />
                  </template>
                </el-table-column>
                <el-table-column key="zgid" label="专柜编号" prop="zgid" width="180">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.zgid" style="width: 155px" :disabled="true" />
                  </template>
                </el-table-column>
                <el-table-column key="zgname" label="专柜名称" prop="zgname" width="180">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.zgname" style="width: 155px" :disabled="true" />
                  </template>
                </el-table-column>
                <el-table-column key="floor" label="楼层" prop="floor" width="160">
                  <template slot-scope="scope">
                    <el-select v-model="scope.row.floor" placeholder="请选择楼层" :disabled="cansave" width="140">
                      <el-option v-for="item in floors" :label="item.code" :value="item.name" />
                    </el-select>
                  </template>
                </el-table-column>
                <el-table-column key="popname" label="名称" prop="popname" width="220">
                  <template slot-scope="scope" width="200">
                    <el-select v-model="scope.row.popname" placeholder="请选择物料" :disabled="cansave" @change="handlePopnameChanged(scope.row)">
                      <el-option v-for="item in popnames" :label="item" :value="item" />
                    </el-select>
                  </template>
                </el-table-column>
                <el-table-column key="poptype" label="规格" prop="poptype" width="150">
                  <template slot-scope="scope">
                    <el-select v-model="scope.row.poptype" placeholder="请选择规格" :disabled="cansave" @change="handlePoptypeChanged(scope.row)">
                      <el-option v-for="item in poptypes" :label="item" :value="item" />
                    </el-select>
                  </template>
                </el-table-column>
                <el-table-column key="amount" label="单价" prop="amount" width="150">
                  <template slot-scope="scope">
                    <el-input v-model.number="scope.row.amount" :disabled="true" />
                  </template>
                </el-table-column>
                <el-table-column key="processcount" label="数量" prop="processcount" width="150">
                  <template slot-scope="scope">
                    <el-input-number v-model.number="scope.row.processcount" style="width: 100px" :min="0" :disabled="cansave" @change="handleProcesscountChanged(scope.row)" />
                  </template>
                </el-table-column>
                <el-table-column key="totalmoney" label="合计金额" prop="totalmoney" width="150">
                  <template slot-scope="scope">
                    <el-input v-model="scope.row.totalmoney" placeholder="" type="" :disabled="true" />
                  </template>
                </el-table-column>
                <el-table-column label="操作" width="auto">
                  <template slot-scope="scope">
                    <el-button size="mini" type="danger" plain :disabled="cansave" @click="deldetails(scope.$index)">删除</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <el-button class="el-icon-circle-plus-outline" :disabled="cansave" @click="adddetails" />
            </template>
          </div>
          <el-row>
            <el-col :span="8">
              <el-form-item label="扣费合计" prop="summoney">
                <u>{{ form.summoney }}</u>元
              </el-form-item>
            </el-col>
          </el-row>
        </div>
        <div class="ContractLinkBox">
          <el-row>
            <el-col :span="8">
              <el-form-item label="缴款时间" prop="signDate" :rules="{required: form.contracttype!=='公司承担', message: '请选择缴款时间', trigger: 'change' }">
                <el-date-picker v-model="form.signDate" width="170" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" :disabled="cansave" />
              </el-form-item>
            </el-col>
          </el-row>
        </div>
        <div>
          <el-row>
            <el-col :span="8">
              <el-form-item label="附件" prop="contractUrl">
                <u-upload-multiple-files v-model="form.fileList" name="file" :disabled="cansave" :size="5" :limit="5" />
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="扣款单号" prop="deductioncode" :hidden="form.deductioncode===0">
                <span>{{ form.deductioncode }}</span>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item label="收入缴存单号" prop="paymentcode" :hidden="form.paymentcode===''">
                <span>{{ form.paymentcode }}</span>
              </el-form-item>
            </el-col>
          </el-row>
        </div>
        <el-form-item v-if="form.applicantusername===form.viewerusername">
          <el-button type="primary" :disabled="cansave" @click="onSave('contractform')">保存</el-button>
          <el-button type="primary" :disabled="cansubmit" @click="onSubmit()">发起流程</el-button>
          <el-button type="primary" :disabled="canmodify" @click="onModify()">修改</el-button>
          <el-button :disabled="canrevoke" @click="onRevoke()">撤销流程</el-button>
          <el-button :disabled="disableflag" @click="onAbate('contractform')">作废</el-button>
        </el-form-item>
      </el-form>
    </u-page>
    <el-drawer
      title="厂商合同信息"
      :visible.sync="fcInfotable"
      direction="rtl"
      size="70%"
    >
      <div style="margin-top: 5px;padding-left: 10px">
        <el-row>
          <el-col :span="8">
            <el-input v-model="keyWord" placeholder="请输入内容" class="input-with-select" @input="keyWordChange()" />
          </el-col>
          <el-col :span="12">
            <div style="font-size:12px;padding-top: 7px">（可输入厂商编号、或厂商名称、或专柜编号、或专柜名称的部份文字进行筛选）</div>
          </el-col>
        </el-row>
      </div>
      <u-table
        :data="fcInfoData"
        :options="listOptions"
        :columns="fcInfocolumns"
      >
        <template v-slot:right>
          <el-table-column label="操作" align="center" fixed="right">
            <template slot-scope="{ row }">
              <el-button type="text" @click="getFirm(row)">选择</el-button>
            </template>
          </el-table-column>
        </template>
      </u-table>
    </el-drawer>
  </div>
</template>

<script>

import { mapGetters } from 'vuex'

export default {
  components: {
  },
  data() {
    return {
      api: this.$u.api.ContractApply,
      dataapi: this.$u.api.OpcenPops,
      listOptions: {
        stripe: true
      },
      dates: 0,
      selectIndex: 0,
      // 保存按钮激活
      cansave: false,
      // 提交按钮激活
      cansubmit: true,
      // 修改按钮激活
      canmodify: true,
      // 撤销流程按钮
      canrevoke: true,
      // 作废按钮
      disableflag: true,
      // 合同类型数组
      contractTypes: [{ id: '1', label: '公司承担', value: '公司承担' }, { id: '2', label: '厂商承担', value: '厂商承担' }],
      formname: '流水号',
      // 合同数据
      contractlist: [],
      // 楼层
      floors: [],
      // pop名称
      popnames: [],
      // pop类型
      poptypes: [],
      // 总金额
      sum: 0,
      deptinfo: {},
      deptList: [],
      // 表单所有数据
      form: {
        code: 0,
        updateflag: false,
        typename: '美陈需求单',
        statusstr: '',
        // 人员信息
        applicantnickname: '',
        applicantusername: '',
        applicantuserid: '',
        preparernickname: '',
        preparerusername: '',
        prepareruserid: '',
        viewerusername: '',
        viewernickname: '',
        applyTime: '',
        endTime: '',
        // usertype: '',
        dept: '',
        deptname: '',
        deptid: '',
        contracttype: '',
        paytype: '',
        firmcode: '',
        firmname: '',
        hth: '',
        zgid: '',
        zgname: '',
        summoney: 0,
        remarks: '',
        demanddetailsData: [],
        // 联系人资料
        brandname: '',
        signDate: '',
        yearmonth: '',
        instanceId: '',
        contractname: '',
        deductioncode: 0,
        paymentcode: '',
        contractpath: ''
      },
      // 规则
      contractform: {
        deptid: [
          { required: true, message: '请选择部门', trigger: 'change' }
        ],
        contracttype: [
          { required: true, message: '请选择合同类型', trigger: 'change' }
        ],
        firmname: [
          { required: true, message: '请填写厂商名称', trigger: 'blur' }
        ],
        summoney: [
          { required: true, message: '请填写合计金额', trigger: 'blur' },
          { type: 'number', message: '金额必须填写数字' }
        ]
      },
      value: '',
      fcInfotable: false,
      // 厂商合同信息
      fcInfoData: [],
      searchfcInfoData: [],
      keyWord: '',
      searchWord: '',
      fcInfocolumns: [
        {
          prop: 'firmcode',
          label: '厂商编号'
        },
        {
          prop: 'firmname',
          label: '厂商名称'
        },
        {
          prop: 'contractcode',
          label: '合同编号'
        },
        {
          prop: 'startdate',
          label: '开始日期',
          render: (h, params) => {
            return h('el-tag', this.$u.timeFormat(new Date(params.row.startdate).getTime(), 'yyyy-mm-dd'))
          }
        },
        {
          prop: 'enddate',
          label: '结束日期',
          render: (h, params) => {
            return h('el-tag', this.$u.timeFormat(new Date(params.row.enddate).getTime(), 'yyyy-mm-dd'))
          }
        },
        {
          prop: 'deptid',
          label: '专柜编号'
        },
        {
          prop: 'dept_name',
          label: '专柜名称'
        },
        {
          prop: 'spsb',
          label: '商标'
        }
      ]
    }
  },
  created() { },
  mounted() {
    this.getDeptList()
    this.getFloors()
    this.getPopInfos()
    // 如果传了参数，则加载数据
    if (this.$route.query.formcode != null) {
      this.getViewers()
      this.getPopFormdata(this.$route.query.formcode)
    } else {
      this.getApplicant()
    }
  },
  computed: {
    ...mapGetters([
      'nickname'
    ])
  },
  methods: {
    // 加载申请人员
    getApplicant() {
      const self = this
      self.api.applicant().then(res => {
        self.form.applicantusername = res.data.username
        self.form.applicantnickname = res.data.usernickname
        self.form.applicantuserid = res.data.userid
        self.form.preparerusername = res.data.username
        self.form.preparernickname = res.data.usernickname
        self.form.prepareruserid = res.data.userid
        self.form.viewerusername = res.data.username
        self.form.viewernickname = res.data.usernickname
        self.form.applyTime = res.data.nowtime
      })
    },
    // 加载查看人
    getViewers() {
      const self = this
      self.api.applicant().then(res => {
        self.form.viewerusername = res.data.username
        self.form.viewernickname = res.data.usernickname
      })
    },
    // 加载部门
    getDeptList() {
      const self = this
      self.api.deptList().then(res => {
        this.deptList = res.data
      })
    },
    // 加载楼层
    getFloors() {
      const self = this
      self.api.floors().then(res => {
        this.floors = res.data
      })
    },
    // 加载pop选项
    getPopInfos() {
      const self = this
      self.dataapi.popinfos(self.form).then(res => {
        this.popnames = res.data.popnames
        this.poptypes = res.data.poptypes
      })
    },
    // 获取厂商信息
    hdlfirmcode() {
      const self = this
      this.form.firmname = ''
      self.api.firmName(self.form).then(res => {
        this.form.firmname = res.data
      })
    },
    // 保存
    onSave(formName) {
      const self = this
      self.$confirm('确认保存吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        // 表单验证
        this.$refs[formName].validate((valid) => {
          if (valid) {
            // 子表单判断
            if (self.form.demanddetailsData.length === 0) {
              self.$message.error('保存失败！需求详情错误！')
              return
            }
            // 判断填写内容完整性
            for (let i = 0; i < this.form.demanddetailsData.length; i++) {
              const row = this.form.demanddetailsData[i]
              // 检查必要字段是否为空
              if (self.form.contracttype === '公司承担') {
                if (!row.floor || !row.popname || !row.poptype || row.processcount === null) {
                  this.$message.error(`第 ${i + 1} 行填写不完整，请检查所有必填项。`)
                  return // 发现空字段，返回
                }
              } else {
                if (!row.firmcode || !row.hth || !row.floor || !row.popname || !row.poptype || row.processcount === null) {
                  this.$message.error(`第 ${i + 1} 行填写不完整，请检查所有必填项。`)
                  return // 发现空字段，返回
                }
              }
            }
            // 通过验证进行提交动作
            self.api.save(self.form).then(res => {
              // 更新表单编号
              this.form.code = res.data
              // 将表单设置为只读
              this.cansave = true
              // 修改提交作废按钮变亮
              this.cansubmit = false
              this.canmodify = false
              this.canrevoke = true
              this.disableflag = false
              // 通知信息
              self.$u.msg(res.msg)
            }).catch(() => {
              return
            })
          } else {
            return false
          }
        })
      }).catch(() => {
        return
      })
    },
    // 修改
    onModify() {
      this.cansave = false
      this.cansubmit = true
      this.canmodify = true
      this.form.updateflag = true
    },
    // 提交
    onSubmit() {
      const self = this
      // 通过验证进行提交动作
      self.api.submit(self.form).then(res => {
        // 通知信息
        self.$u.msg(res.msg)
        // 初始化数据
        // 刷新页面
        self.$router.go(0)
      }).catch(() => {
        return
      })
    },
    // 撤销钉钉流程
    onRevoke() {
      const self = this
      // 通过验证进行提交动作
      self.api.revoke(self.form).then(res => {
        // 通知信息
        self.$u.msg(res.data)
        // 修改按钮状态
        // 将表单设置为只读
        this.cansave = true
        this.cansubmit = true
        this.canmodify = false
        this.canrevoke = true
        this.disableflag = false
        self.form.statusstr = '撤销流程'
      }).catch(() => {
        return
      })
    },
    // 作废
    onAbate() {
      const self = this
      // 通过验证进行提交动作
      self.api.abate(self.form).then(res => {
        // 通知信息
        self.$u.msg(res.data)
        // 刷新页面
        self.$router.go(0)
      }).catch(() => {
        return
      })
    },
    // 编辑功能:监听组织变化
    handledeptChanged(value, label) {
      const self = this
      self.form.deptname = this.$refs['depts'].getCheckedNodes()[0].label
      self.form.deptid = this.$refs['depts'].getCheckedNodes()[0].value
    },
    // 处理合同类型改变事件
    handleContracttypeChanged(value) {
      if (value === '公司承担') {
        this.form.paytype = '账扣'
      } else if (value === '第三方承担') {
        this.form.paytype = '现金缴款'
      } else if (this.form.paytype === '') {
        this.form.paytype = '账扣'
      }
    },
    // 添加需求详情
    adddetails() {
      const self = this
      if (self.form.deptname === '') {
        self.$message.error('请先选择扣款部门！')
        return
      }
      if (self.form.itemtype === '') {
        self.$message.error('请选择物料类型！')
        return
      }
      self.form.demanddetailsData.push({
        floor: '',
        popname: '',
        poptype: '',
        amount: '',
        processcount: 0,
        totalmoney: 0
      })
    },
    // 删除需求详情
    deldetails(index) {
      const self = this
      self.$confirm('确认删除吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        // 点击确定的操作
        self.form.demanddetailsData.splice(index, 1)
        // 重新计算合计金额
        this.handlemoneyChanged()
      }).catch(() => {
        return
      })
    },
    // 物料类型更改
    itemtypeChange() {
      const self = this
      self.dataapi.popnames(self.form).then(res => {
        this.popnames = res.data.popnames
      })
    },
    handlePopnameChanged(row) {
      const self = this
      row.poptype = ''
      row.amount = ''
      row.amount = ''
      row.totalmoney = ''
      self.dataapi.poptypes(row).then(res => {
        this.poptypes = res.data.poptypes
      })
      this.handlemoneyChanged()
    },
    // 选择开始日期
    handlePoptypeChanged(row) {
      const self = this
      if (row.popname !== '') {
        self.dataapi.popdata(row).then(res => {
          row.amount = res.data.amount
          if (row.amount !== '') {
            row.totalmoney = parseFloat(row.amount) * row.processcount
          }
        })
      }
      this.handlemoneyChanged()
    },
    handleProcesscountChanged(row) {
      if (row.amount !== '') {
        row.totalmoney = parseFloat(row.amount) * row.processcount
        this.handlemoneyChanged()
      }
    },
    // 金额改变
    handlemoneyChanged() {
      const self = this
      self.sum = 0
      self.form.demanddetailsData.forEach(item => {
        self.sum += item.totalmoney
      })
      self.form.summoney = self.sum
    },
    // 选择厂商合同数据
    fetchData(index) {
      const self = this
      self.selectIndex = index
      self.api.allfcInfos(self.form).then(res => {
        this.fcInfoData = res.data
        this.searchfcInfoData = res.data
      })
      self.fcInfotable = true
    },
    // 打开厂商资料弹窗
    /* handleFCInfos() {
      const self = this
      if (self.form.deptname === '') {
        self.$message.error('请先选择扣款部门！')
        return
      }
      self.api.fcInfos(self.form).then(res => {
        this.fcInfoData = res.data
        this.searchfcInfoData = res.data
      })
      self.fcInfotable = true
    },*/
    // 输入关键字
    keyWordChange() {
      const self = this
      // 表格用原表格的数据 即 用于搜索的总数据
      // self.fcInfoData = self.searchfcInfoData
      const _search = self.keyWord
      const newListData = [] // 用于存放搜索出来数据的新数组
      if (self.keyWord !== '') {
        // filter 过滤数组
        this.searchfcInfoData.filter((item) => {
          // newListData中 没有查询的内容，就添加到newListData中
          if (
            item.firmname.indexOf(_search) !== -1 ||
            item.firmcode.indexOf(_search) !== -1 ||
            item.deptid.indexOf(_search) !== -1 ||
            item.dept_name.indexOf(_search) !== -1
          ) {
            newListData.push(item)
          }
        })
        this.fcInfoData = newListData
      } else {
        self.fcInfoData = self.searchfcInfoData
      }
    },
    //  获取表单数据并初始化参数
    getPopFormdata(formcode) {
      const self = this
      self.form.code = formcode
      self.form.typename = '美陈需求单'
      self.api.popformdata(self.form).then(res => {
        const maindata = res.data
        const { popdata } = maindata
        self.form.applicantusername = maindata.applicantusername
        self.form.applicantnickname = maindata.applicantnickname
        self.form.applicantuserid = maindata.applicantuserId
        self.form.preparerusername = maindata.preparerusername
        self.form.preparernickname = maindata.preparernickname
        self.form.applyTime = maindata.starttime
        self.form.endTime = maindata.endtime
        if (maindata.instanceId !== '') {
          self.form.instanceId = maindata.instanceId
        }
        if (popdata.deductioncode !== 0) {
          self.form.deductioncode = popdata.deductioncode
        }
        if (popdata.paymentcode !== '') {
          self.form.paymentcode = popdata.paymentcode
        }
        self.form.agreementtype = maindata.agreementtype
        self.form.deptname = popdata.deptname
        self.form.deptid = popdata.deptid
        self.form.contracttype = popdata.contracttype
        self.form.paytype = popdata.paytype
        self.form.firmcode = popdata.firmcode
        self.form.firmname = popdata.firmname
        self.form.zgid = popdata.zgid
        self.form.zgname = popdata.zgname
        self.form.hth = popdata.hth
        self.form.summoney = popdata.summoney
        self.form.remarks = popdata.remarks
        self.form.fileList = popdata.fileList
        self.form.signDate = popdata.signDateStr
        self.form.dept = popdata.dept
        self.form.itemtype = popdata.itemtype
        // popdata
        if (maindata.status === 0) {
          // 将表单设置为只读
          this.cansave = true
          this.cansubmit = false
          this.canmodify = false
          this.canrevoke = true
          this.disableflag = false
          self.form.statusstr = '未提交'
        } else if (maindata.status === 1) {
          this.cansave = true
          this.cansubmit = true
          this.canmodify = true
          this.canrevoke = false
          this.disableflag = false
          self.form.statusstr = '流转中'
        } else if (maindata.status === 2) {
          this.cansave = true
          this.cansubmit = true
          this.canmodify = true
          this.canrevoke = true
          this.disableflag = true
          self.form.statusstr = '签核完成'
        } else if (maindata.status === 3) {
          // 将表单设置为只读
          this.cansave = true
          this.cansubmit = true
          this.canmodify = false
          this.canrevoke = true
          this.disableflag = false
          self.form.statusstr = '驳回'
        } else if (maindata.status === 4) {
          // 将表单设置为只读
          this.cansave = true
          this.cansubmit = true
          this.canmodify = false
          this.canrevoke = true
          this.disableflag = false
          self.form.statusstr = '撤销流程'
        } else if (maindata.status === 5) {
          this.cansave = true
          this.canmodify = true
          this.cansubmit = true
          this.canrevoke = true
          this.disableflag = true
          self.form.statusstr = '作废'
        }
        self.form.demanddetailsData = popdata.demanddetailsData
      })
    },
    // 厂商弹窗选择功能
    getFirm(row) {
      const self = this
      const index = self.selectIndex
      // 使用 this.$set 来确保响应式更新
      self.$set(self.form.demanddetailsData, index, {
        ...self.form.demanddetailsData[index], // 保留原有字段
        firmcode: row.firmcode,
        firmname: row.firmname,
        hth: row.contractcode,
        zgid: row.deptid,
        zgname: row.dept_name
      })
      self.fcInfotable = false
    }
  }
}
</script>

<style scoped>
.contractCheckBox {
  padding-bottom: 5px;
  border-bottom: 1px solid #c0c4cc;
}
.contractCheckBox .el-form-item{
  margin-bottom:3px;
}
.contractCheckBox .el-form-item--small .el-form-item{
  margin-bottom:3px;
}
.contractDetailBox{
  padding-top: 5px;
  border-bottom: 1px solid #c0c4cc;
}
.ContractLinkBox{
  padding-top: 10px;
}
::v-deep input[disabled],input:disabled,input.disabled {
  color:#000000 !important;
  background-color:#f1f1f1 !important;
}
::v-deep textarea[disabled],textarea:disabled,textarea.disabled {
  color:#000000 !important;
  background-color:#f1f1f1 !important;
}
</style>
